package com.itheima.test5;

public class Test {


    public static void main(String[] args) {
        useAnimal(new Dog());
    }

    public static void useAnimal(Animal a){
        a.eat();

    }
}


abstract class Animal {
    public abstract void eat();

    public void drink() {
        System.out.println("喝水");
    }

}
class Dog extends Animal{

    @Override
    public void eat() {
        System.out.println("狗吃狗粮");
    }
}